﻿<%@ Page Title="" Language="C#" AutoEventWireup="true" Inherits="System.Web.Mvc.ViewPage<IPagedList<IPublishable>>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <ul id="submenu">
        <li><%= Html.ActionLink("管理随笔", "PostManage", "Admin", null, new{ id="managepost" }) %></li>
        <li><%= Html.ActionLink("写新随笔", "NewPost", "Admin", null, new{ id="newpost" }) %></li>
        <li><a href='#' title="may be later?? page for example">更多</a></li>
    </ul>
    
    <h2>随笔管理</h2>
    <table>
        <thead>
            <tr><td>标题</td><td>操作</td></tr>
        </thead>
        <tbody>
            <% if(null != Model && Model.Count > 0){  
                foreach(Post post in Model){ %>
                <tr>
                    <td><%= post.Title %></td>
                    <td>
                        <%= Html.ActionLink("编辑", "EditPost", new { id = post.Id }) %>&nbsp;
                        <%= Html.ActionLink("删除", "DelPost", new { id = post.Id }, new { onclick = "return confirm('你确定要删除该随笔?')" })%>
                    </td> 
                </tr>
            <% } } %>
        </tbody>
    </table>
    <div class="pager">
		<%= Html.Pager(ViewData.Model.PageSize, ViewData.Model.PageIndex, ViewData.Model.TotalItemCount, new RouteValueDictionary() { {"controller", "Home"}, {"action", "Index"} })%>
	</div>
    <script type="text/javascript" language="javascript">
        SetCurrentTag("postmanage");
        SetCurrentTag("managepost");
    </script>
</asp:Content>
